<!--
 * @Author: wjk
 * @Date: 2020-01-09 16:06:59
 * @LastEditors: wangzm
 * @LastEditTime: 2020-03-10 16:23:43
 * @description: 商品详情页箱起赠品
 -->
<template>
  <view>
    <view v-if="box_present_list.length" class="goods-found">
      <view class="sLine boxPresent" @click="showPopup">
        <view class="lCont">赠品</view>
        <view class="rCont">
          <view v-for="(item, index) in box_present_list" :key="index">
            {{ item.give_remark || '' }}
            <!-- 11111{{ `${item.title} (满${item.buy_num}赠${item.give_num}) X ${item.give_num * (Math.floor(buyCountAry.count /item.buy_num))}` }} -->
          </view>
        </view>
      </view>
    </view>
    <!-- <base-popup :show="pShow" :show-close="false" @close="closePopup">
      <view class="maskContainer couponMask">
        <view class="cartClose" @click="closePopup">
          <image src="/static/images/icon/icon_close.png" />
        </view>
        <view>
        </view>
      </view>
    </base-popup> -->
  </view>
</template>
<script>
export default {
  name: 'CommodityBoxGoods',
  components: {
  },
  props: {
    allData: {
      type: Object,
      required: true,
      default: null // 是否显示遮罩层
    },
    buyCountAry: {
      type: Object,
      default: () => {
        return {
          max: 9999,
          min: 1,
          count: 1
        }
      }
    }
  },
  data() {
    return {
      box_present_list: [],
      pShow: false
    }
  },
  created() {
    this.box_present_list = this.allData.goods.present_list
  },
  methods: {
    closePopup() {
      this.$set(this, 'pShow', false)
    },
    showPopup() {
      this.pShow = true
    }
  }
}
</script>
<style lang="scss" scoped>
.boxPresent{
  height: auto !important;
  min-height: 100rpx;
  .rCont{
    @include flex(column);
    align-items: flex-start !important;
  }
}
</style>
